<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>simAddForce</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1>Regular API function</h1>
<h3 class=subsectionBar><a name="simAddForce" id="simAddForce"></a>simAddForce / sim.addForce </h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>Adds a non-central force to a shape object that is dynamically enabled. Added forces are cumulative, and are reset to zero after <a href="simHandleDynamics.htm">sim.handleDynamics</a> was called (or by using the following flag: sim.handleflag_resetforcetorque). See also <a href="simAddForceAndTorque.htm">sim.addForceAndTorque</a>.<br></td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn>simInt simAddForce (simInt shapeHandle,const simFloat* position,const simFloat* force)</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
<div><strong>shapeHandle</strong>: handle of a dynamically enabled shape. Can be combined with sim.handleflag_resetforcetorque in order to clear the accumulated force and torque.</div>
<div><strong>position</strong>: pointer to 3 values that represent the relative position where the force should be applied.</div>
<div><strong>force</strong>: pointer to 3 values that represent the force (in relative coordinates) to add.</div>
<div></div></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
<div>-1 if operation was not successful</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>sim.addForce(int shapeHandle,table[3] position,table[3] force)</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div>Similar to the C-function counterpart</div>
<div></div></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div>-</div>
</td> 
</tr> 
</table> 


<br>
</td>
</tr>
</table>
</div>
</body>
</html>
